#!C:\ruby\bin\ruby.exe
require 'rexml/document'
include REXML
documento = ARGV[0]
file = File.new(documento)
doc = Document.new(file)
XPath.each(doc,"//habitacion[puerta[@a]]/text()") { |nodo|
  puts nodo
}